package com.woniu.controller;

import com.woniu.entity.OrderItems;
import com.woniu.service.OrderItemsService;
import com.woniu.service.impl.OrderItemsServiceImpl;

import java.util.List;

public class OrderItemsCotroller {
    public static void insertOrderItems(OrderItems orderItems) {
         OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
         orderItemsService.insertOrderItems(orderItems);
    }
    public static List<OrderItems> getOrderItems(Integer orderId) {
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        List<OrderItems> orderItems = orderItemsService.getOrderItems(orderId);
        return orderItems;
    }
    public static void deleteOrderItems(Integer id) {
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        orderItemsService.deleteOrderItems(id);
    }
    public static List<OrderItems> getOrderItemsByMid(Integer mid) {
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        List<OrderItems> orderItemsByMid = orderItemsService.getOrderItemsByMid(mid);
        return orderItemsByMid;
    }

    public static void updateOrderItemsStatus(Integer merchant_id, int status){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        orderItemsService.updateOrderItemsStatus(merchant_id, status);
    }
    public static void updateOrderItemsByOrderId(Integer order_id,int status){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        orderItemsService.updateOrderItemsByOrderId(order_id,status);
    };

    public static List<OrderItems> getOrderItemsByStatus(Integer merchant_id, Integer status){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        List<OrderItems> orderItems = orderItemsService.getOrderItemsByStatus(merchant_id, status);
        return orderItems;
    }
    public static void deleteByMid(Integer merchant_id, Integer status){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        orderItemsService.deleteByMid(merchant_id, status);
    }
    public static List<OrderItems> getOrderItemsByPid(Integer merchant_id, Integer pid){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        return orderItemsService.getOrderItemsByPid(merchant_id, pid);
    }
    public static void updateOrderItemsByOrderItemId(Integer order_item_id,int status){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        orderItemsService.updateOrderItemsByOrderItemId(order_item_id,status);
    };
    public static List<OrderItems> getOrderItemsByStatus(Integer status){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        return orderItemsService.getOrderItemsByStatus(status);
    };
    public static List<OrderItems> getOrderItemsIf( Integer product_id,Integer merchant_id){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        return orderItemsService.getOrderItemsIf(product_id,merchant_id);
    }
    public static List<OrderItems> selectOrderItemsByPid(Integer pid){
        OrderItemsServiceImpl orderItemsService = new OrderItemsServiceImpl();
        return orderItemsService.selectOrderItemsByPid(pid);
    }
}
